<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <script src="js/axios.js"></script>
    <title>登录</title>
</head>
<body>
<form>
    账号：<input type="text" id="username" name="username"> <br/>
    密码：<input type="password" id="password" name="password"> <br/>
    <input type="button" value="登 录" onclick="login()">
</form>
</body>
<script type="text/javascript">
    function login(){
        let username = document.getElementById("username").value
        let password = document.getElementById("password").value
        let formData = new FormData()
        formData.append("username",username)
        formData.append("password",password)
        axios.post("http://localhost:8080/user/login",formData).then(function (response) {
            console.log(response)
        }).catch(function (error) {
            console.log(error)
        })
    }
</script>
</html>